﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Threading;

namespace Ji.JiControl
{
    public static class DispatcherHelper
    {
        public static void AsyncUIAction(this Dispatcher dispatcher, Action action)
        {
            if (dispatcher != null)
            {
                dispatcher.BeginInvoke(action);
            }
        }

        public static void AsyncAction(this Action action, AsyncCallback callback = null, object data = null)
        {
            if (action != null)
            {
                action.BeginInvoke(callback, data);

            }
        }

    }
}
